﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FantastPlatform.Community.IMode;
using FantastPlatform.Community.IService;
using FantastPlatform.Framework;

namespace FantastPlatform.Community.UI.Message
{
    public partial class SendMessageForm : BasePage
    {
        public string groupName = string.Empty;
        protected string pIdStr;
        protected void Page_Load(object sender, EventArgs e)
        {
            pIdStr = Request["pId"];
            if (!string.IsNullOrEmpty(pIdStr))
            {
                List<int> idList = new List<int>();
                string[] idStrList = pIdStr.Split(',');

                IMailListService ms = ServiceFactory.CreateService<IMailListService>();
                foreach (string id in idStrList)
                {
                    IMailList mail = ms.Get(Int32.Parse(id));
                    if (mail != null)
                    {
                        groupName += mail.Name + ";";
                    }
                }
                if (!string.IsNullOrEmpty(groupName))
                {
                    groupName = groupName.Substring(0, groupName.Length - 1);
                }
            }
        }
    }
}